package com.example.easy.mapper;

import com.example.easy.Dto.Infobar;
import com.example.easy.Dto.Notice;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface InfobarMapper {


    @Insert("Insert into infobar (number,title,content,time)Values(#{number},#{title},#{content},#{time})")
    int insInfobar(Infobar infobar);//插入

    @Update("UPDATE infobar  SET title=#{title},content=#{content},time=#{time} WHERE number=#{number}")
    int updateInfobar(Infobar infobar);//修改

    @Delete("DELETE FROM infobar WHERE  number=#{number}")
    int deleteInfobar(int number);//删除

    @Select("SELECT * FROM infobar  WHERE number=#{number} ")
    Infobar selectInfobar(int number);//查看文章所有信息

    @Select("SELECT * FROM infobar ")
    List <Infobar> selectall();//查看所有文章

}
